package com.youyiwen.Mapper;

import com.youyiwen.Bean.User;
import org.apache.ibatis.annotations.*;

/**
 * @Author: zhaoyang
 * @Date: 2021/03/04
 */
@Mapper
public interface UserMapper {
    @Select("select password from user where userName = #{userName} ")
    public String searchPasswordByName(String userName);

    @Select("select role from user where userName = #{userName}")
    public String searchRole(String userName);

    @Select("select * from user where userName = #{userName} ")
    public User selectUserByName(String userName);

    public void insertUser(User user);

    @Update("update user set name = #{name},telephone = #{telephone}, email = #{email}, city = #{city},img_url = #{url}" +
            " where userName = #{userName}")
    public void updateInfo(@Param("name") String name,
                           @Param("telephone") String telephone,
                           @Param("email") String email,
                           @Param("city") String city,
                           @Param("url") String url,
                           @Param("userName") String UserName);
}
